VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "DAOPuntoVenta"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'---------------------------------------------------------------------------------------
' Module    : DAOPuntoVenta
' DateTime  : 30/11/2011 12:13
' Author    :
' Purpose   : Clase DAO PuntoVenta
'---------------------------------------------------------------------------------------
Option Explicit
Private mvarConnection As utilConexion
Public Property Set Connection(ByVal vData As utilConexion)
    Set mvarConnection = vData
End Property
Public Function getBean(ByVal bean As bCompania) As bPuntoVenta
On Error GoTo hnderr
Dim result As bPuntoVenta
Dim sql As String
Dim rst As New Recordset
sql = "SELECT * FROM proc_puntoventa_lista('" + bean.sRuc + "','" + bean.bPuntoVenta.sSerie + "')"
rst.Open sql, mvarConnection.Connection, adOpenForwardOnly
If Not rst.EOF Then
    Set result = New bPuntoVenta
    If Not IsNull(rst.Fields("snomimpresora")) Then result.snomImpresora = rst.Fields("snomimpresora").value
    If Not IsNull(rst.Fields("sserimpresora")) Then result.sSerImpresora = rst.Fields("sserimpresora").value
    If Not IsNull(rst.Fields("nnumboleta")) Then result.nNumBoleta = rst.Fields("nnumboleta").value
    If Not IsNull(rst.Fields("nnumfactura")) Then result.nNumFactura = rst.Fields("nnumfactura").value
    If Not IsNull(rst.Fields("sdireccion")) Then result.sDireccion = rst.Fields("sdireccion").value
    If Not IsNull(rst.Fields("stelefono")) Then result.sTelefono = rst.Fields("stelefono").value
    If Not IsNull(rst.Fields("sserie")) Then result.sSerie = rst.Fields("sserie").value
End If
Set getBean = result
hnderr:
If Err.Number = 0 Then Exit Function
utilMensaje.muestraMensaje errorEncontrado
End Function

